package com.adobesamples.controller.command {
  import com.adobesamples.controller.events.ColorChosenEvent;
  import com.adobesamples.controller.events.FontChosenEvent;
  import com.adobesamples.controller.events.NameTextChosenEvent;
  import com.adobesamples.state.ModelState;
  import com.adobesamples.state.model;

  public class ChangeNameCommand {
    private var _modelState: ModelState;

    public function ChangeNameCommand(modelState: ModelState) {
      _modelState = modelState;
    }

    public function changeNameColor(event:ColorChosenEvent): void {
      _modelState.currentConfiguration.model::setNameFontColor(event.color);
    }

    public function changeNameText(event:NameTextChosenEvent): void {
      _modelState.currentConfiguration.model::setNameText(event.nameText);
    }

    public function changeNameFont(event:FontChosenEvent): void {
      _modelState.currentConfiguration.model::setNameFont(event.font);
    }
  }
}